local PLUGIN = {}
PLUGIN.Title = "Play Time"
PLUGIN.Description = "Play Time Plugin"
PLUGIN.Author = "REMSCAR - Conjoint Gaming"
PLUGIN.ChatCommand = "playtime"
PLUGIN.Usage = "[players]"
PLUGIN.Privileges = { "playtime" }

function PLUGIN:Call( ply, args )
	if ( ply:EV_HasPrivilege( "playtime" ) ) then
		local players = evolve:FindPlayer( args, ply )
		
		if ( #players > 0 ) then
		
		for _, pl in ipairs( players ) do
			evolve:Notify( evolve.colors.blue, pl:Nick(), evolve.colors.white, " has played ", evolve.colors.green, evolve:FormatTime(tonumber(pl:GetProperty( "PlayTime" ))), evolve.colors.white, "." )
		end
			else
			evolve:Notify( ply, evolve.colors.red, evolve.constants.noplayers )
		end
	else
		evolve:Notify( ply, evolve.colors.red, evolve.constants.notallowed )
	end
end

function PLUGIN:Menu( arg, players )
	if ( arg ) then
		RunConsoleCommand( "ev", "playtime", unpack( players ) )
	else
		return "playtime", evolve.category.administration
	end
end

evolve:RegisterPlugin( PLUGIN )